﻿using Avalonia.Media;

namespace FantomNext.Controls
{
    public class FantomTextBox : FantomShape
    {
        public string Text = "hello, world!";

        public FontFamily FontFamily = new FontFamily("Microsoft Yahei");

        public double FontSize = 32;

        public FontWeight FontWeight = FontWeight.Regular;

        public FantomTextBox(string id) : base(id)
        {

        }

        public override void Render(DrawingContext context)
        {
            var typeface = new Typeface(FontFamily, FontStyle.Normal, FontWeight, FontStretch.Normal);
            var foreground = Brushes.Red;
            var text = new FormattedText(Text, System.Globalization.CultureInfo.CurrentCulture, FlowDirection, typeface, FontSize, foreground);

            context.DrawText(text, new Avalonia.Point());
        }
    }
}
